﻿@using Kaiser.Cubic.Service
@{
    ViewBag.Title = "NewsList";
    Layout = "/Views/Shared/_Layout.cshtml";
      var service = new CubicServiceClient();
      
    var newsList = service.GetNewsByCategoryId(Request["ctid"]);


    if (newsList.Count() == 1)
    {
        Response.Redirect(Url.Action("NewsDetail", "News") + "?id=" + newsList.FirstOrDefault().Id);
    }
}


<div class="index_center">
    <div class="bg"></div>
    <div class="conBg">
        @RenderPage("/Views/Shared/Menu.cshtml")
        <div class="erBanner">
            <a href="#">
                <img src="/images/News_03.png" /></a>
        </div>
        <div class="ercon">
            <div class="erconTitle"><a href="#">Home</a><span>></span><em>News</em></div>
            <div class="erLeft">
                <div class="erLeftTitle">About Cubic</div>
                 
                    @Html.Partial("NewsCategoryLeft")
                 
            </div>
            <div class="erRight">
                <div class="erRightTitle">News</div>
                <div class="erRight_1">
                    <ul>
                        @foreach (var item in newsList)
                        {
                            <li><span>@item.PublishDateTime.ToString("dd-MM-yyyy")</span><a href="@Url.Action("NewsDetail","News")?id=@item.Id">@item.TitleShort</a></li>
                        }
                    </ul>
                    <div class="erFen"><a href="#">Pre</a><span>1</span><a href="#">2</a><a href="#">3</a><a href="#">4</a><em>...</em><a href="#">20</a><a href="#">Next</a></div>
                </div>
            </div>
        </div>
        @RenderPage("/Views/Shared/Foot.cshtml")
    </div>
</div>
